package org.rcgwt.client.ui.grid.renderer;

import org.rcgwt.client.ui.grid.internal.model.IElementModel;
import org.rcgwt.client.ui.grid.internal.model.IElementModelDelta;

import com.google.gwt.dom.client.Element;

/**
 * Render specific element
 * 
 * @author Matthieu ROBERT & Olivier Oeuillot
 * 
 * @param <M>
 */
public interface IRenderer<M extends IElementModel> {

    Element render(IViewRenderContext renderContext, Element parentElement,
            M modelElement, int renderedIndex);

    void processDelta(IViewRenderContext renderContext, Element element,
            IElementModelDelta<M> modelElementDelta);

    void update(IViewRenderContext viewRenderContext, Element element,
            M modelElement, int renderedIndex);

    int[] getSizes(IViewRenderContext viewRenderContext, Element element,
            M modelElement, int sizes[]);
}
